package cj.web.marriage.dao;
/*
 *  
 *  
*/
import java.util.List;

import net.paoding.rose.jade.annotation.DAO;
import net.paoding.rose.jade.annotation.SQL;
import net.paoding.rose.jade.annotation.SQLParam;
import cj.web.marriage.domain.MarriagePhotoRef;

/**
 * 
 * @author 
 *
 */
@DAO
public interface MarriagePhotoRefDAO{
	
	@SQL("SELECT * FROM MarriagePhotoRef  #if(:t.code!=''){ WHERE code like '%##(:t.code)%' } ORDER BY createAt DESC LIMIT :t.start,:t.length ")
    List<MarriagePhotoRef> queryList(@SQLParam("t") MarriagePhotoRef marriagePhotoRef);
	
	@SQL("SELECT count(1) FROM MarriagePhotoRef  #if(:t.code!=''){ WHERE code like '%##(:t.code)%' } ")
    int querySize(@SQLParam("t") MarriagePhotoRef marriagePhotoRef);
    
    @SQL("select * from MarriagePhotoRef where code=:1")
    MarriagePhotoRef queryByCode(String code);
    
    @SQL("INSERT INTO MarriagePhotoRef (code,photo,status,createAt) VALUES (:t.code,:t.photo,:t.status,now())")
    void create(@SQLParam("t") MarriagePhotoRef marriagePhotoRef);
	
	@SQL("UPDATE MarriagePhotoRef SET photo=:t.photo,status=:t.status WHERE id=:t.id")
    void update(@SQLParam("t") MarriagePhotoRef marriagePhotoRef);
}